package com.gancp.utills;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.util.Properties;

/**
 * Created by GCP on 2018/5/9.
 */
public class FileUtils {
    public static void readPro() throws IOException {
        Resource resource = new ClassPathResource( "filepath.properties" );
        Properties properties = PropertiesLoaderUtils.loadProperties( resource );
        String apath = properties.getProperty( "Afile" );
        String bPath = properties.getProperty( "Bfile" );
    }

    public static void readUrl() throws IOException {
        Resource resource = new UrlResource( "file:AtmApInit.txt" );
        InputStream inputStream = resource.getInputStream();
        System.out.println( inputStream == null );


    }
}
